home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Griffith 0.9.8 / griffith-0.9.8-win32.exe / {app} / lib / update.py < prev    next >
Text File  |  2008-11-17  |  2KB  |  63 lines

  1. # -*- coding: UTF-8 -*-
  2.  
  3. __revision__ = '$Id: update.py 1040 2008-11-15 21:13:49Z mikej06 $'
  4.  
  5. # Copyright (c) 2005-2008 Vasco Nunes, Piotr O┼╝arowski
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU Library General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  20.  
  21. # You may use and distribute this software under the terms of the
  22. # GNU General Public License, version 2 or later
  23.  
  24. from sqlalchemy import Select, desc
  25. import gutils
  26. import os
  27.  
  28. def update_volume_combo_ids(self):
  29.     self.volume_combo_ids = {}
  30.     self.volume_combo_ids[0] = 0
  31.     i = 1
  32.     volumes = Select(self.db.Volume.c, order_by='name')
  33.     for volume in volumes.execute().fetchall():
  34.         self.volume_combo_ids[i] = volume.volume_id
  35.         i += 1
  36.  
  37. def update_collection_combo_ids(self):
  38.     self.collection_combo_ids = {}
  39.     self.collection_combo_ids[0] = 0
  40.     i = 1
  41.     collections = Select(self.db.Collection.c, order_by='name')
  42.     for collection in collections.execute().fetchall():
  43.         self.collection_combo_ids[i] = collection.collection_id
  44.         i += 1
  45.  
  46. def update_loanedto_combo_ids(self):
  47.     self.loanedto_combo_ids = {}
  48.     self.loanedto_combo_ids[0] = 0
  49.     i = 1
  50.     persons = Select(self.db.Person.c, order_by='name')
  51.     for person in persons.execute().fetchall():
  52.         self.loanedto_combo_ids[i] = person.person_id
  53.         i += 1
  54.  
  55. def update_bytag_combo_ids(self):
  56.     self.bytag_combo_ids = {}
  57.     self.bytag_combo_ids[0] = 0
  58.     i = 1
  59.     tags = Select(self.db.Tag.c, order_by='name')
  60.     for tag in tags.execute().fetchall():
  61.         self.bytag_combo_ids[i] = tag.tag_id
  62.         i += 1
  63.